<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        window.onload=function(){
          var oUl=document.getElementById('ul1');
          var aA=document.getElementsByTagName('a');
          for(var i=0;i<aA.length;i++){
              aA[i].onclick=function(){
                this.parentNode.style.display='none';
              };

          }

        };
    </script>
</head>
<body>
 <ul id="ul1">
     <li>ddgagfa <a href="javascript:;">隐藏</a></li>
     <li>14326543 <a href="javascript:;">隐藏</a></li>
     <li>agahsrhys <a href="javascript:;">隐藏</a></li>
     <li>64575676 <a href="javascript:;">隐藏</a></li>
     <li>agbcghsfh <a href="javascript:;">隐藏</a></li>
 </ul>
</body>
</html>